<template>

        <div class="validcode-container">
          <!-- <el-input v-model=".captchaText" style="width: 60%"></el-input> -->
          <img id="verImg" @click="refreshCaptcha" :src="captchaUrl"  alt="Captcha">
        </div>
     
</template>

<script>
import {getCaptchaUrl} from '@/api/order'

    export default {
      props:["room_id"],
        data(){
          return {
            
           captchaUrl:"",
          }
        },
        created(){
    
    this.refreshCaptcha();
  },
  methods:{
    refreshCaptcha() {
 getCaptchaUrl(this.room_id).then(res=>{
console.log(res)
this.captchaUrl=window.URL.createObjectURL(res);
 })
      
      }
    //   var verKey;
    // // 获取验证码
    // $.axios('/captcha', function(res) {
    //     verKey = res.key;
    //     $('#verImg').attr('src', res.image);
    // },'json');
        }
     

        
        
    
    }
  //   console.log(new Date())
  //  this.captchaUrl = `http://localhost:28080/captcha/`+this.room_id+`?t=`+new Date().getTime();

  

    
</script>